/*
 * Copyright (C) 2010-2101 Alibaba Group Holding Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.alibaba.otter.manager.biz.statistics.throughput.dal;

import com.alibaba.otter.manager.biz.statistics.throughput.dal.dataobject.ThroughputStatDO;
import com.alibaba.otter.manager.biz.statistics.throughput.param.RealtimeThroughputCondition;
import com.alibaba.otter.manager.biz.statistics.throughput.param.ThroughputCondition;
import com.alibaba.otter.manager.biz.statistics.throughput.param.TimelineThroughputCondition;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author simon
 */
@Mapper
public interface ThroughputStatDao extends BaseMapper<ThroughputStatDO> {

    void insertThroughputStat(ThroughputStatDO throughputStat);

    void deleteThroughputStat(Long throughputStatId);

    void modifyThroughputStat(ThroughputStatDO throughputStat);

    ThroughputStatDO findThroughputStatById(Long throughputStatId);

    List<ThroughputStatDO> listRealtimeThroughputStat(RealtimeThroughputCondition condition);

    List<ThroughputStatDO> listTimelineThroughputStat(TimelineThroughputCondition condition);

    ThroughputStatDO findRealtimeThroughputStat(ThroughputCondition condition);

    List<ThroughputStatDO> listThroughputStatByPipelineId(Long pipelineId);

    List<ThroughputStatDO> listRealTimeThroughputStatByPipelineIds(@Param("pipelineIds") List<Long> pipelineIds, @Param("minute") long minute);
}
